#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
	int app_h[10] = { 0 };
	int i = 0, ch_h, digit = 0;
	for (i = 0; i < 10; i++){
		scanf("%d", &app_h[i]);
	}
	i--;
	scanf("%d", &ch_h);
	for (; i >= 0; i--) {
		if (ch_h + 30 >= app_h[i])
			digit++;
	}
	printf("%d", digit);
	return 0;
}//